import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;

/**
 * @author 徒有琴
 */
public class MySqlTest {
    public static void main(String[] args) throws Exception {
        Class.forName("com.mysql.jdbc.Driver");
        Connection connection = DriverManager.getConnection("jdbc:mysql://www.hf1901.com:3306/1901", "root", "root");
        String sql = "INSERT INTO person(name,age) VALUES(?,?)";
        PreparedStatement ps = connection.prepareStatement(sql);
        for (int i = 0; i < 500000; i++) {
            ps.setObject(1,i);
            ps.setObject(2,i);
            ps.executeUpdate();
        }
        ps.close();
        connection.close();
    }
}
